#ifndef VARIABLE_SUPPORT
#define VARIABLE_SUPPORT

#include "main.h"

typedef enum{
    TYPE_U8,
    TYPE_U16,
    TYPE_U32,
    TYPE_U64,
    TYPE_INT,
    TYPE_I8,
    TYPE_I16,
    TYPE_I32,
    TYPE_I64,
    TYPE_FLOAT,
    TYPE_DOUBLE,
    TYPE_MAX
}Variable_TYPE;

typedef union
{
    uint8_t raw[8];
    uint8_t u8;
    uint16_t u16;
    uint32_t u32;
    uint64_t u64;
    int i;
    int8_t i8;
    int16_t i16;
    int32_t i32;
    int64_t i64;
    float f;
    double d;
}Variable_data;


static inline uint8_t SIZEOF(int a) {
    if (a == TYPE_U8 || a == TYPE_I8) return 1;
    else if (a == TYPE_U16 || a == TYPE_I16) return 2;
    else if (a == TYPE_U32 || a == TYPE_I32 || a == TYPE_INT || a == TYPE_FLOAT) return 4;
    else if (a == TYPE_U64 || a == TYPE_I64 || a == TYPE_DOUBLE) return 8;
    return 0;
}


#endif // !VARIABLE_SUPPORT
